package com.isoftstone.disk.user.repository;

import com.isoftstone.disk.login.entity.PtUserEntity;
import com.isoftstone.disk.mybatis.flexigrid.PagingBean;
import com.isoftstone.disk.mybatis.ztree.ZtreeEntity;
import com.isoftstone.disk.user.entity.SearUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao {
    List<PtUserEntity> queryUserInfoListPadding(@Param("search") SearUserEntity searUserEntity,@Param("paging") PagingBean pagingBean);

    Integer queryUserInfoTotal(@Param("search")SearUserEntity searUserEntity);

    List<ZtreeEntity> queryRoleZtreeList(@Param("userUuid") String userUuid);

    List<String> queryRoleListByUserId(@Param("userUuid") String userUuid);

    void deleteRoleByUserId(@Param("userId") String userId);

    void insertRoleAndUserRef(@Param("userId")String userId,@Param("roleId") String roleId);

    //用户注册
    int add(PtUserEntity user);
    //查找用户是否已存在
    PtUserEntity findOne(String name);
}
